/*
 * DrawableString.h
 *
 *  Created on: 2011-4-6
 *      Author: wangchao
 */

#ifndef YUEBAOSPLASHSTRING_H_
#define YUEBAOSPLASHSTRING_H_
#include <e32cmn.h>
#include <gdi.h>
class fDrawer;
class DrawableString
{
public:
    DrawableString( );
    ~DrawableString( );
public:
    void Draw( fDrawer& gfx, TInt aSpeed, TInt aPosX, TInt aPosY, TInt aColor, const CFont * aFont, const TDesC16& aStr, bool bScroll );
private:
    int _scrollLength;
    int _areaWidth;
    int _textWidth;
    bool _flag;
public:
    void Update( int nAreaWidth, int nTextWidth )
    {
        _scrollLength = 0;
        _areaWidth = nAreaWidth;
        _textWidth = nTextWidth;
        _flag = false;
    }
};
class fText : public DrawableString
{
public:
    fText( ) :
        DrawableString( ), _initialized( false )
    {
        
    }
protected:
    bool _initialized;
public:
    bool hasInitialized( )
    {
        return _initialized;
    }
    void Initialize( int nAreaWidth, int nTextWidth )
    {
        Update( nAreaWidth, nTextWidth );
        _initialized = true;
    }
};
#endif /* YUEBAOSPLASHSTRING_H_ */
